package com.esl.action.admin;

import java.util.Map;

import javax.annotation.Resource;

import org.apache.struts2.convention.annotation.Result;
import org.apache.struts2.json.annotations.JSON;

import com.esl.action.CommonAction;
import com.esl.dto.admin.Task_Dto;
import com.esl.service.admin.TaskManager;
@Result(name = "tolist", location = "task?jump_url=list", type = "redirect")

public class TaskAction extends CommonAction{
	private Task_Dto task_Dto = new Task_Dto();
	private TaskManager taskManager;
	private Map<String, Object> session = getSession();

	public String add() {
		taskManager.add(task_Dto.toTask());
		return "tolist";
	}

	public String load() {
		setPageInfo_Dto(taskManager.load(1, 5, "", ""));
		return "success";
	}

	/*--------------------------------*/
	@JSON(serialize = false)
	public Task_Dto getTask_Dto() {
		return task_Dto;
	}
	
	public void setTask_Dto(Task_Dto task_Dto) {
		this.task_Dto = task_Dto;
	}

	

	/*--------------------------------*/
	
	public TaskManager getTaskManager() {
		return taskManager;
	}
	@Resource
	public void setTaskManager(TaskManager taskManager) {
		this.taskManager = taskManager;
	}
	
}
